<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Student Details</f:facet>

        <s:decorate id="id" template="layout/display.xhtml">
            <ui:define name="label">Id</ui:define>
            <h:outputText value="#{studentHome.instance.id}"/>
        </s:decorate>

        <s:decorate id="firstName" template="layout/display.xhtml">
            <ui:define name="label">First name</ui:define>
            <h:outputText value="#{studentHome.instance.firstName}"/>
        </s:decorate>

        <s:decorate id="lastName" template="layout/display.xhtml">
            <ui:define name="label">Last name</ui:define>
            <h:outputText value="#{studentHome.instance.lastName}"/>
        </s:decorate>

        <s:decorate id="passportPhotoUrl" template="layout/display.xhtml">
            <ui:define name="label">Passport photo url</ui:define>
            <h:outputText value="#{studentHome.instance.passportPhotoUrl}"/>
        </s:decorate>

        <s:decorate id="dateOfBirth" template="layout/display.xhtml">
            <ui:define name="label">Date of birth</ui:define>
            <h:outputText value="#{studentHome.instance.dateOfBirth}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="registerNumber" template="layout/display.xhtml">
            <ui:define name="label">Register number</ui:define>
            <h:outputText value="#{studentHome.instance.registerNumber}"/>
        </s:decorate>

        <s:decorate id="rollNumber" template="layout/display.xhtml">
            <ui:define name="label">Roll number</ui:define>
            <h:outputText value="#{studentHome.instance.rollNumber}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/StudentEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty studentFrom ? 'StudentList' : studentFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>UserAccount</h:panelGroup>
        </f:facet>
    <div class="association" id="userAccountParent">

        <h:outputText value="There is no userAccount associated with this student."
                   rendered="#{studentHome.instance.userAccount == null}"/>

        <rich:dataTable var="_userAccount"
                   value="#{studentHome.instance.userAccount}"
                rendered="#{studentHome.instance.userAccount != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="userAccountTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_userAccount.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">UserAccountname</f:facet>
                <h:outputText value="#{_userAccount.username}"/>
            </h:column>
           
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewuserAccount"
                     value="View"
                      view="/UserAccount.xhtml">
                    <f:param name="userAccountId"
                           value="#{_userAccount.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Course</h:panelGroup>
        </f:facet>
    <div class="association" id="courseParent">

        <h:outputText value="There is no course associated with this student."
                   rendered="#{studentHome.instance.course == null}"/>

        <rich:dataTable var="_course"
                   value="#{studentHome.instance.course}"
                rendered="#{studentHome.instance.course != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="courseTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_course.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Teacher id</f:facet>
                <h:outputText value="#{_course.teacher.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Course name</f:facet>
                <h:outputText value="#{_course.courseName}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Details</f:facet>
                <h:outputText value="#{_course.details}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewcourse"
                     value="View"
                      view="/Course.xhtml">
                    <f:param name="courseId"
                           value="#{_course.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Student previous acad detailses</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="studentPreviousAcadDetailsesChildren">

        <h:outputText value="There are no studentPreviousAcadDetailses associated with this student."
                   rendered="#{empty studentHome.studentPreviousAcadDetailses}"/>

        <rich:dataTable value="#{studentHome.studentPreviousAcadDetailses}"
                       var="_studentPreviousAcadDetails"
                  rendered="#{not empty studentHome.studentPreviousAcadDetailses}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="studentPreviousAcadDetailsesTable">
            <rich:column sortBy="#{_studentPreviousAcadDetails.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_studentPreviousAcadDetails.id}"/>
            </rich:column>
            <rich:column sortBy="#{_studentPreviousAcadDetails.courseName}">
                <f:facet name="header">Course name</f:facet>
                <h:outputText value="#{_studentPreviousAcadDetails.courseName}"/>
            </rich:column>
            <rich:column sortBy="#{_studentPreviousAcadDetails.instName}">
                <f:facet name="header">Inst name</f:facet>
                <h:outputText value="#{_studentPreviousAcadDetails.instName}"/>
            </rich:column>
            <rich:column sortBy="#{_studentPreviousAcadDetails.phone}">
                <f:facet name="header">Phone</f:facet>
                <h:outputText value="#{_studentPreviousAcadDetails.phone}"/>
            </rich:column>
            <rich:column sortBy="#{_studentPreviousAcadDetails.decription}">
                <f:facet name="header">Decription</f:facet>
                <h:outputText value="#{_studentPreviousAcadDetails.decription}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectstudentPreviousAcadDetails"
                     value="Select"
                      view="/StudentPreviousAcadDetails.xhtml">
                    <f:param name="studentPreviousAcadDetailsId"
                            value="#{_studentPreviousAcadDetails.id}"/>
                    <f:param name="studentPreviousAcadDetailsFrom" value="Student"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add studentPreviousAcadDetails"
                view="/StudentPreviousAcadDetailsEdit.xhtml">
            <f:param name="studentId"
                    value="#{studentHome.instance.id}"/>
            <f:param name="studentPreviousAcadDetailsFrom" value="Student"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Student cerficates</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="studentCerficatesChildren">

        <h:outputText value="There are no studentCerficates associated with this student."
                   rendered="#{empty studentHome.studentCerficates}"/>

        <rich:dataTable value="#{studentHome.studentCerficates}"
                       var="_studentCerficate"
                  rendered="#{not empty studentHome.studentCerficates}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="studentCerficatesTable">
            <rich:column sortBy="#{_studentCerficate.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_studentCerficate.id}"/>
            </rich:column>
            <rich:column sortBy="#{_studentCerficate.receivedStatus}">
                <f:facet name="header">Received status</f:facet>
                <h:outputText value="#{_studentCerficate.receivedStatus}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectstudentCerficate"
                     value="Select"
                      view="/StudentCerficate.xhtml">
                    <f:param name="studentCerficateId"
                            value="#{_studentCerficate.id}"/>
                    <f:param name="studentCerficateFrom" value="Student"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add studentCerficate"
                view="/StudentCerficateEdit.xhtml">
            <f:param name="studentId"
                    value="#{studentHome.instance.id}"/>
            <f:param name="studentCerficateFrom" value="Student"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Parents</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="parentsChildren">

        <h:outputText value="There are no parents associated with this student."
                   rendered="#{empty studentHome.parents}"/>

        <rich:dataTable value="#{studentHome.parents}"
                       var="_parent"
                  rendered="#{not empty studentHome.parents}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="parentsTable">
            <rich:column sortBy="#{_parent.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_parent.id}"/>
            </rich:column>
            <rich:column sortBy="#{_parent.firstName}">
                <f:facet name="header">First name</f:facet>
                <h:outputText value="#{_parent.firstName}"/>
            </rich:column>
            <rich:column sortBy="#{_parent.lastName}">
                <f:facet name="header">Last name</f:facet>
                <h:outputText value="#{_parent.lastName}"/>
            </rich:column>
            <rich:column sortBy="#{_parent.mobileNumber}">
                <f:facet name="header">Mobile number</f:facet>
                <h:outputText value="#{_parent.mobileNumber}"/>
            </rich:column>
            <rich:column sortBy="#{_parent.officePhone}">
                <f:facet name="header">Office phone</f:facet>
                <h:outputText value="#{_parent.officePhone}"/>
            </rich:column>
            <rich:column sortBy="#{_parent.email}">
                <f:facet name="header">Email</f:facet>
                <h:outputText value="#{_parent.email}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectparent"
                     value="Select"
                      view="/Parent.xhtml">
                    <f:param name="parentId"
                            value="#{_parent.id}"/>
                    <f:param name="parentFrom" value="Student"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add parent"
                view="/ParentEdit.xhtml">
            <f:param name="studentId"
                    value="#{studentHome.instance.id}"/>
            <f:param name="parentFrom" value="Student"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Student certificate locations</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="studentCertificateLocationsChildren">

        <h:outputText value="There are no studentCertificateLocations associated with this student."
                   rendered="#{empty studentHome.studentCertificateLocations}"/>

        <rich:dataTable value="#{studentHome.studentCertificateLocations}"
                       var="_studentCertificateLocation"
                  rendered="#{not empty studentHome.studentCertificateLocations}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="studentCertificateLocationsTable">
            <rich:column sortBy="#{_studentCertificateLocation.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_studentCertificateLocation.id}"/>
            </rich:column>
            <rich:column sortBy="#{_studentCertificateLocation.locationUrl}">
                <f:facet name="header">Location url</f:facet>
                <h:outputText value="#{_studentCertificateLocation.locationUrl}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectstudentCertificateLocation"
                     value="Select"
                      view="/StudentCertificateLocation.xhtml">
                    <f:param name="studentCertificateLocationId"
                            value="#{_studentCertificateLocation.id}"/>
                    <f:param name="studentCertificateLocationFrom" value="Student"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add studentCertificateLocation"
                view="/StudentCertificateLocationEdit.xhtml">
            <f:param name="studentId"
                    value="#{studentHome.instance.id}"/>
            <f:param name="studentCertificateLocationFrom" value="Student"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Student extra detailses</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="studentExtraDetailsesChildren">

        <h:outputText value="There are no studentExtraDetailses associated with this student."
                   rendered="#{empty studentHome.studentExtraDetailses}"/>

        <rich:dataTable value="#{studentHome.studentExtraDetailses}"
                       var="_studentExtraDetails"
                  rendered="#{not empty studentHome.studentExtraDetailses}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="studentExtraDetailsesTable">
            <rich:column sortBy="#{_studentExtraDetails.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_studentExtraDetails.id}"/>
            </rich:column>
            <rich:column sortBy="#{_studentExtraDetails.nationality}">
                <f:facet name="header">Nationality</f:facet>
                <h:outputText value="#{_studentExtraDetails.nationality}"/>
            </rich:column>
            <rich:column sortBy="#{_studentExtraDetails.motherTongue}">
                <f:facet name="header">Mother tongue</f:facet>
                <h:outputText value="#{_studentExtraDetails.motherTongue}"/>
            </rich:column>
            <rich:column sortBy="#{_studentExtraDetails.gender}">
                <f:facet name="header">Gender</f:facet>
                <h:outputText value="#{_studentExtraDetails.gender}"/>
            </rich:column>
            <rich:column sortBy="#{_studentExtraDetails.numberOfSiblings}">
                <f:facet name="header">Number of siblings</f:facet>
                <h:outputText value="#{_studentExtraDetails.numberOfSiblings}"/>
            </rich:column>
            <rich:column sortBy="#{_studentExtraDetails.bloodGroup}">
                <f:facet name="header">Blood group</f:facet>
                <h:outputText value="#{_studentExtraDetails.bloodGroup}"/>
            </rich:column>
            <rich:column sortBy="#{_studentExtraDetails.remarks}">
                <f:facet name="header">Remarks</f:facet>
                <h:outputText value="#{_studentExtraDetails.remarks}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectstudentExtraDetails"
                     value="Select"
                      view="/StudentExtraDetails.xhtml">
                    <f:param name="studentExtraDetailsId"
                            value="#{_studentExtraDetails.id}"/>
                    <f:param name="studentExtraDetailsFrom" value="Student"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add studentExtraDetails"
                view="/StudentExtraDetailsEdit.xhtml">
            <f:param name="studentId"
                    value="#{studentHome.instance.id}"/>
            <f:param name="studentExtraDetailsFrom" value="Student"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Student emergency contacts</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="studentEmergencyContactsChildren">

        <h:outputText value="There are no studentEmergencyContacts associated with this student."
                   rendered="#{empty studentHome.studentEmergencyContacts}"/>

        <rich:dataTable value="#{studentHome.studentEmergencyContacts}"
                       var="_studentEmergencyContact"
                  rendered="#{not empty studentHome.studentEmergencyContacts}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="studentEmergencyContactsTable">
            <rich:column sortBy="#{_studentEmergencyContact.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_studentEmergencyContact.id}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectstudentEmergencyContact"
                     value="Select"
                      view="/StudentEmergencyContact.xhtml">
                    <f:param name="studentEmergencyContactId"
                            value="#{_studentEmergencyContact.id}"/>
                    <f:param name="studentEmergencyContactFrom" value="Student"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add studentEmergencyContact"
                view="/StudentEmergencyContactEdit.xhtml">
            <f:param name="studentId"
                    value="#{studentHome.instance.id}"/>
            <f:param name="studentEmergencyContactFrom" value="Student"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
